package com.bm.server.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bm.common.dto.DynamicDto;
import com.bm.server.entity.Dynamic;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface DynamicDao  extends BaseMapper<Dynamic> {
    @Insert("insert into t_dynamic (uid,message,location,state,img1,img2,img3,img4) " +
            "value (#{uid},#{message},#{location},#{state},#{img1},#{img2},#{img3},#{img4})")
    int insertDynamic(@Param("uid") int uid, @Param("message") String message, @Param("location") String location,
                   @Param("state") String state, @Param("img1") String img1, @Param("img2") String img2, @Param("img3") String img3, @Param("img4") String img4);

    //查询动态
    @Select("select * from t_dynamic where uid = #{uid} order by ctime desc")
    List<DynamicDto> selectDynamic(int uid);
}
